package com.bytedance.improvingroad.activity

import com.bytedance.improvingroad.databinding.ActivityBottomSheetBinding
import com.bytedance.improvingroad.widget.ModalBottomSheet
import com.bytedance.improvingroad.widget.ModalFullBottomSheet
import com.google.android.material.bottomsheet.BottomSheetBehavior

class BottomSheetActivity : BaseBindingActivity<ActivityBottomSheetBinding>() {
    override fun initData() {

    }

    override fun initListener() {
        binding.normalBottomSheet.setOnClickListener {
            val behavior = BottomSheetBehavior.from(binding.bottomSheet)
            behavior.state = if (behavior.state == BottomSheetBehavior.STATE_EXPANDED) {
                BottomSheetBehavior.STATE_COLLAPSED
            } else {
                BottomSheetBehavior.STATE_EXPANDED
            }
        }
        binding.dynamicBottomSheet.setOnClickListener {
            ModalBottomSheet().show(supportFragmentManager,ModalBottomSheet.TAG)
        }

        binding.dynamicBottomBigSheet.setOnClickListener {
            ModalFullBottomSheet().show(supportFragmentManager,ModalFullBottomSheet.TAG)
        }
    }
}